home *** CD-ROM | disk | FTP | other *** search
/ User's Choice Windows CD / User's Choice Windows CD (CMS Software)(1993).iso / misc1 / iv26_w30.zip / INTERVIE / CURSOR.H < prev    next >
C/C++ Source or Header  |  1992-02-25  |  3KB  |  82 lines

  1. /*
  2.  * Copyright (c) 1987, 1988, 1989 Stanford University
  3.  *
  4.  * Permission to use, copy, modify, distribute, and sell this software and its
  5.  * documentation for any purpose is hereby granted without fee, provided
  6.  * that the above copyright notice appear in all copies and that both that
  7.  * copyright notice and this permission notice appear in supporting
  8.  * documentation, and that the name of Stanford not be used in advertising or
  9.  * publicity pertaining to distribution of the software without specific,
  10.  * written prior permission.  Stanford makes no representations about
  11.  * the suitability of this software for any purpose.  It is provided "as is"
  12.  * without express or implied warranty.
  13.  *
  14.  * STANFORD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  15.  * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
  16.  * IN NO EVENT SHALL STANFORD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  17.  * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  18.  * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  19.  * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
  20.  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  21.  */
  22.  
  23. /*
  24.  * An input cursor is defined by two 16x16 bitmaps, one that
  25.  * specifies which pixels are to be drawn and one that specifies
  26.  * which pixels are in foreground color and which in background color.
  27.  * If a device does not support a mask the background pixels are not drawn.
  28.  */
  29.  
  30. #ifndef cursor_h
  31. #define cursor_h
  32.  
  33. #include <InterViews\defs.h>
  34.  
  35. static const int cursorHeight = 16;
  36. static const int cursorWidth = 16;
  37.  
  38. typedef int CursorPattern[cursorHeight];
  39.  
  40. class Color;
  41. class Bitmap;
  42. class Font;
  43.  
  44. class Cursor {
  45. public:
  46.     Cursor(
  47.     short xoff, short yoff,            /* hot spot */
  48.     CursorPattern pat, CursorPattern mask,    /* pattern, mask */
  49.     Color* fg, Color* bg
  50.     );
  51.     Cursor(Bitmap* pat, Bitmap* mask, Color* fg, Color* bg);
  52.     Cursor(Font*, int pat, int mask, Color* fg, Color* bg);
  53.     Cursor(long int c, Color* fg, Color* bg);
  54.     ~Cursor();
  55.  
  56.     void* Id();
  57. private:
  58.     void* id;
  59.     short x, y;
  60.     int* pat, * mask;
  61.     Color* foreground, *background;
  62.     boolean is_stock_cursor;
  63. };
  64.  
  65. /*
  66.  * Predefined cursors.
  67.  */
  68.  
  69. extern Cursor* defaultCursor;
  70. extern Cursor* arrow;
  71. extern Cursor* crosshairs;
  72. extern Cursor* ltextCursor;
  73. extern Cursor* rtextCursor;
  74. extern Cursor* hourglass;
  75. extern Cursor* upperleft;
  76. extern Cursor* upperright;
  77. extern Cursor* lowerleft;
  78. extern Cursor* lowerright;
  79. extern Cursor* noCursor;
  80.  
  81. #endif
  82.